{% extends 'goods/goodbase.html' %}

{#{% block breadcrumb %}#}
{#        这里填 全部分类 > 新鲜水果 > 商品详情  这个#}
{##}
{#    <div class="breadcrumb">#}
{#        <a href="/">全部分类</a>#}
{#        <span>></span>#}
{#        <a href="/list/1/{{ type.id }}/1/">{{ type.ttitle }}</a>#}
{#    </div>#}
{#{% endblock breadcrumb %}#}


{% block r_wrap %}
    {#    <div class="r_wrap fr clearfix">#}

    <div class="sort_bar">

        <a href="/list/{{ type.id }}/1/"  {% if sortid == 1 %} class="active"  {% endif %} > 默认</a>

        {% if sortid == 2 %}
            <a href="/list/{{ type.id }}/3/" class="active">价格</a>
        {% elif sortid == 3 %}
            <a href="/list/{{ type.id }}/2/" class="active">价格</a>
        {% else %}
            <a href="/list/{{ type.id }}/2/">价格</a>
        {% endif %}

        <a href="/list/{{ type.id }}/4/" {% if sortid == 4 %} class="active" {% endif %} > 人气</a>
    </div>


    <ul class="goods_type_list clearfix">
        {#        <h1>{{ page }}</h1>#}
        {% for foo in page %}
            <li>
                <a href="/{{ foo.object.id }}/"><img src="/static/media/{{ foo.object.gpic }}"></a>
                <h4><a href="detail.html">{{ foo.object.gtitle }}</a></h4>
                <div class="operate">
                    <span class="prize">￥{{ foo.object.gprice }}</span>
                    <span class="unit">{{ foo.object.gprice }}/{{ foo.object.gunit }}</span>
                    <a href="#" class="add_goods" title="加入购物车"></a>
                </div>
            </li>
        {% endfor %}

    </ul>

    <div class="pagenation">


{#        {% for p in pagenumberlist %}#}
            {#                {{ page }}#}
            {#                    <a>{{ page }}</a>   /page/typeid/sortid/#}
            {#                    <a>{{ good.number }}--{{ page }}</a>#}
{#            {% if p == page.number %}#}
{#                <a href="#" class="active">{{ page }}</a>#}
{#            {% else %}#}
{#                <a href="/list/{{ page }}/{{ type.id }}/{{ sortid }}/">{{ page }}</a>#}
{#            {% endif %}#}
{#        {% endfor %}#}



        {% if page.has_previous or page.has_next %}
            <div>
                {% if page.has_previous %}<a href="?q={{ query }}&page={{ page.previous_page_number }}">{% endif %}« 上一页
                {% if page.has_previous %}</a>{% endif %}
                |
{#                {% for p in pagenumberlist %}#}
                    {#                {{ page }}#}
                    {#                    <a>{{ page }}</a>   /page/typeid/sortid/#}
                    {#                    <a>{{ good.number }}--{{ page }}</a>#}
{#                    {% if p == page.number %}#}
{#                        <a href="#" class="active">{{ p }}</a>#}
{#                    {% else %}#}
{#                        <a href="?q={{ query }}&page={{ p }}">{{ p }}</a>#}
{#                    {% endif %}#}
{#                {% endfor %}#}

                |


                {% if page.has_next %}<a href="?q={{ query }}&page={{ page.next_page_number }}">{% endif %}下一页 »
                {% if page.has_next %}</a>{% endif %}
            </div>
        {% endif %}


    </div>




    {#        这里填商品页,详情页,列表页不一样的地方 #}
{% endblock r_wrap %}





'query': self.query,
'form': self.form,
'page': page,
'paginator': paginator,
'suggestion': None,

{{ query }}
{{ form }}
{{ page }}
{{ paginator }}
{{ suggestion }}


{#<h2>Search</h2>#}
{##}
{#<form method="get" action=".">#}
{#    <table>#}
{#        {{ form.as_table }}#}
{#        <tr>#}
{#            <td> </td>#}
{#            <td>#}
{#                <input type="submit" value="Search">#}
{#            </td>#}
{#        </tr>#}
{#    </table>#}
{##}
{#    {% if query %}#}
{#        <h3>Results</h3>#}
{##}
{#        {% for result in page.object_list %}#}
{#            <p>#}
{#                <a href="{{ result.object.get_absolute_url }}">{{ result.object.title }}</a>#}
{#            </p>#}
{#        {% empty %}#}
{#            <p>No results found.</p>#}
{#        {% endfor %}#}
{##}
{#        {% if page.has_previous or page.has_next %}#}
{#            <div>#}
{#                {% if page.has_previous %}<a href="?q={{ query }}&page={{ page.previous_page_number }}">{% endif %}« Previous{% if page.has_previous %}</a>{% endif %}#}
{#                |#}
{#                {% if page.has_next %}<a href="?q={{ query }}&page={{ page.next_page_number }}">{% endif %}Next »{% if page.has_next %}</a>{% endif %}#}
{#            </div>#}
{#        {% endif %}#}
{#    {% else %}#}
{# Show some example queries to run, maybe query syntax, something else? #}
{#    {% endif %}#}
{#</form>#}